﻿using OSharp.Utility.Filter;
using Serenity.Utility.Mvc.UI;

namespace OSharp.Web.Mvc.Extensions
{
    /// <summary>
    /// 扩展辅助操作方法
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// 将分页数据转换为表格数据格式
        /// </summary>
        public static MiniGridData<TData> ToMiniGridData<TData>(this PageResult<TData> pageResult)
        {
            return new MiniGridData<TData>(pageResult.Data, pageResult.Total);
        }
    }
}